package com.fsm.common.log.entity.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;


/**
 *  表定义层。
 *
 * @author 
 * @since 
 */
public class TSystemLoginLogTable extends TableDef {

    private static final long serialVersionUID = 1L;

    /**
     *
     */
    public static final TSystemLoginLogTable T_SYSTEM_LOGIN_LOG = new TSystemLoginLogTable();

    /**
     * id
     */
    public final QueryColumn ID = new QueryColumn(this, "id");

    /**
     * 用户ID
     */
    public final QueryColumn USER_ID = new QueryColumn(this, "user_id");

    /**
     * 系统端类型
     */
    public final QueryColumn SYSTEM_TYPE = new QueryColumn(this, "system_type");

    /**
     * 调用状态（0：失败；1：成功）
     */
    public final QueryColumn CALL_STATE = new QueryColumn(this, "call_state");

    /**
     * 登陆访问时间
     */
    public final QueryColumn LOGIN_TIME = new QueryColumn(this, "login_time");

    /**
     * 访问退出时间
     */
    public final QueryColumn EXIT_TIME = new QueryColumn(this, "exit_time");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, USER_ID, SYSTEM_TYPE, CALL_STATE, LOGIN_TIME, EXIT_TIME};

    public TSystemLoginLogTable() {
        super("", "t_system_login_log");
    }

    private TSystemLoginLogTable(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public TSystemLoginLogTable as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new TSystemLoginLogTable("", "t_system_login_log", alias));
    }

}
